FROM python:3-slim

# https://gitee.com/chuanwan/snmpsim/repository/archive/master.zip
ADD ./master.zip /tmp/master.zip

RUN pip install /tmp/master.zip -i https://mirrors.aliyun.com/pypi/simple/ \
    && rm -rf /tmp/master.zip \
    && adduser --system snmpsim

# ADD data /usr/local/snmpsim/data

EXPOSE 161/udp

CMD /usr/local/bin/snmpsim-command-responder --agent-udpv4-endpoint=0.0.0.0:161 --process-user=snmpsim --process-group=nogroup --data-dir=/usr/local/share/snmpsim/data $EXTRA_FLAGS
